export const ROLES = {
  SUPER_ADMIN: "super_admin", // 超级管理员
  ADMIN: "admin", // 普通管理员
  MEMBER: "member", // 团队成员
  GUEST: "guest", // 访客
};

// 权限定义
export const PERMISSIONS = {
  // 用户管理权限
  MANAGE_USERS: "manage_users", // 管理用户
  VIEW_USERS: "view_users", // 查看用户

  // 内容管理权限
  MANAGE_CONTENT: "manage_content", // 管理内容
  EDIT_CONTENT: "edit_content", // 编辑内容
  VIEW_CONTENT: "view_content", // 查看内容

  // 团队管理权限
  MANAGE_TEAM: "manage_team", // 管理团队
  INVITE_MEMBERS: "invite_members", // 邀请成员
  REMOVE_MEMBERS: "remove_members", // 移除成员

  // 系统设置权限
  MANAGE_SYSTEM: "manage_system", // 管理系统
  VIEW_ANALYTICS: "view_analytics", // 查看分析
};

// 角色权限映射
export const ROLE_PERMISSIONS = {
  [ROLES.SUPER_ADMIN]: [
    ...Object.values(PERMISSIONS), // 超级管理员拥有所有权限
  ],

  [ROLES.ADMIN]: [
    PERMISSIONS.MANAGE_USERS,
    PERMISSIONS.VIEW_USERS,
    PERMISSIONS.MANAGE_CONTENT,
    PERMISSIONS.EDIT_CONTENT,
    PERMISSIONS.VIEW_CONTENT,
    PERMISSIONS.MANAGE_TEAM,
    PERMISSIONS.INVITE_MEMBERS,
    PERMISSIONS.REMOVE_MEMBERS,
    PERMISSIONS.VIEW_ANALYTICS,
  ],

  [ROLES.MEMBER]: [
    PERMISSIONS.VIEW_USERS,
    PERMISSIONS.EDIT_CONTENT,
    PERMISSIONS.VIEW_CONTENT,
    PERMISSIONS.VIEW_ANALYTICS,
  ],

  [ROLES.GUEST]: [PERMISSIONS.VIEW_CONTENT],
};
